Repository navigation
Conversation
image_source_ir gives the impulse response of a rectangular room by the image source method of Allen and Berkley (1979), as ita_roomacoustics_imagesources of the ITA-Toolbox: the free-field Green's function of every image source within the duration, weighted by the reflection factors of the six walls it goes through, each arrival placed between samples by a Hann-windowed sinc. Tests check against sums of spherical waves: the anechoic case, one reflecting wall, two walls with different factors and their corner image, and the opposite wall. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
image_source_ir(dimensions, source, receiver, samplingRate, duration, reflection=1, half_width=8)topytta.rooms: the impulse response of a rectangular room by the image source method of Allen and Berkley (1979), asita_roomacoustics_imagesourcesof the ITA-Toolbox.The images x = 2 l Lx + (1 - 2u) x0 (u = 0, 1, and the same in y and z) within c times the duration contribute the free-field Green's function δ(t - d/c) / (4π d). Each carries the reflection factor of the wall x = 0 to the power |l - u| and that of x = Lx to the power |l|, and likewise for y and z. The six factors are real and constant.
ita_roomacoustics_imagesourcesderives them from a wall impedance Z as (Z - ρc) / (Z + ρc). Each arrival is placed between samples by a Hann-windowed sinc. Convolved with ρ dQ/dt of the source, the response gives the pressure.The tests in
tests/test_image_sources.pycompare the spectrum of the response, below a quarter of the sampling rate where the windowed sinc is flat, with sums of spherical waves:A comparison of the decay with the reverberation time of Eyring was tried and left out. In a rectangular room with the same factor on every wall, the specular decay is not exponential. The paths close to the axes meet fewer walls and dominate the late part, so the decay came out 48 % longer than Eyring in a nearly cubic room.
Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of
development(3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com